package com.czxy.Controller;

import com.czxy.BaseResult;
import com.czxy.Service.TeaService;
import com.czxy.Teacher;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author ：陈进南
 * @date ：Created in 2020/12/28 20:11
 * @description：陈进南的无敌代码
 */
@RestController
@RequestMapping("/tea")
public class TeaController {
    @Resource
    private TeaService teaService;

    @PostMapping
    public BaseResult insert(@RequestBody Teacher teacher){
        teaService.insert(teacher);

        return BaseResult.ok("添加成功");
    }
    @DeleteMapping("/{id}")
    public BaseResult del(@PathVariable("id") Integer id){
        teaService.del(id);
        return BaseResult.ok("删除成功");
    }
}
